<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%><%@taglib
	uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>Register to join with me</title>
	<meta  charset="UTF-8" />
	<link href="css/style.css" rel="stylesheet" type="text/css" />
	<!--[if IE 6]>
		<link href="css/ie6.css" rel="stylesheet" type="text/css" />
	<![endif]-->
	<!--[if IE 7]>
        <link href="css/ie7.css" rel="stylesheet" type="text/css" />  
	<![endif]-->
	
	<style type="text/css">
	table thead th{
		background-color: #49ADE8;
	}
	
	table tr td{
		background-color: #F0F0F0;
	}
	
	.menu-head{
		margin-left:10px;
		font-size:15px; 
		color:white;
	}
	</style>
</head>

<body>
	  <div id="background">
			  <div id="page">
			
					 <div class="header">
						<div class="footer">
							<div class="body">
							  
							  	<!-- include Menu -->
									<jsp:include page="Menu.jsp" flush="True">
										<jsp:param name="page_call"  value="AdminPage"/>
									</jsp:include>
									
									<div id="content" >
									    <img src="images/cotton-flower.jpg" width="726" height="546" alt="" title="">
									    <div class="pagetitlebar">Admin page
											<span class="menu-head">
												<a href="AdminBookList.jsp">ข้อมูลหนังสือ</a> |
												ประเภทหนังสือ |
												<a href="AdminReviewBookList.jsp">จัดการรีวิวหนังสือ</a> |
												<a href="AdminBookList.jsp">จัดการข่าว</a>
											</span>
										</div>
									    
										<div class="pagecontent">
										<b>รายการประเภทหนังสือ</b>| <a href="AdminBookTypeDetail.jsp">เพิ่มรายการใหม่</a>
												<sql:setDataSource dataSource="jdbc/sharewithme" var="sharewithme" />
													<c:catch var="ex">
														<sql:query var="bookTypes" dataSource="${sharewithme}">
															select BTypeID,BTypeName from TBBookType
														</sql:query>
													</c:catch>
													
													
												
													
											<table style="border:1px solid; width:100%">
												<thead>
													<th>ID</th>
													<th>ประเภทหนังสือ</th>
												</thead>
												
												
												<c:forEach items="${bookTypes.rows}" var="bookType">
													<tr>
														<td align="center"><a href="AdminBookTypeDetail.jsp?bookTypeId=${bookType.BTypeID}">${bookType.BTypeID}</a></td>
														<td>${bookType.BTypeName}</td>
													</tr>
												</c:forEach>
												
											</table>	
								

							</div>
									
									</div>
									
									
						</div>
					 </div>
					 <div class="shadow">&nbsp;</div>
			  </div>    
	  </div>    
	</div>
</body>
</html>